package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Charge;
import cn.wolfcode.crm.mapper.ChargeMapper;
import cn.wolfcode.crm.mapper.PaymenMapper;
import cn.wolfcode.crm.query.ChargeQueryObject;
import cn.wolfcode.crm.service.IChargeService;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/6/12.
 */

@Service
public class ChargeServiceImpl implements IChargeService{

    @Autowired
    private ChargeMapper chargeMapper;



    @Override
    public  PageResult query(ChargeQueryObject qo) {
        int count = chargeMapper.query4Count(qo);
        if (count > 0) {
            return new PageResult(count, chargeMapper.query4List(qo));
        }
        return new PageResult(count, Collections.EMPTY_LIST);
    }

    @Override
    public void deleteById(Long id) {
        chargeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Charge> selectAll() {
        return chargeMapper.selectAll();
    }


}
